import {ProFormRadio, ProFormText} from "@ant-design/pro-form";
import {Image, message, Modal, Radio} from "antd";
import React from 'react';

const MyComponent = (props) => {
  const { edit,setEdit } = props
  return (
    <Modal
      visible={edit}
      modalProps={ {
        onCancel:() => {setEdit(false)}
      } }
      onFinish={async (values) => {
        console.log(values.name);
        message.success('提交成功');
        return setEdit(false);
      }}
    >
      <div style={ {marginLeft: '0px'} }>
        <ProFormRadio.Group
          name="P_pic"
          label="配送员头像"
          tooltip="配送员头像"

        >
          <Image
            width={60}
            src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSFCLBqo0p_ZYZUBBRmPdGEZWpCxm2ZQhVDOg&usqp=CAU"
          />
        </ProFormRadio.Group>
      </div>
      <div>
        <ProFormText
          name="name"
          label='配送员名称'
          tooltip="配送员名称"
          placeholder='配送员名称'
        />
      </div>
      <div>
        <ProFormText
          name="phone"
          label='手机号码'
          tooltip="手机号码"
          placeholder='手机号码'
        />
      </div>
      <div>
        <ProFormRadio.Group
          name="radio-code"
          label="配送员状态"
          tooltip="配送员状态"
        >
          <Radio.Group defaultValue={1}>
            <Radio value={1}>显示</Radio>
            <Radio value={2}>隐藏</Radio>
          </Radio.Group>
        </ProFormRadio.Group>
      </div>
    </Modal>
  );
};

export default MyComponent;
